package com.huanong.it.xwcommon.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class MyConfig {
        @Bean
        public MybatisPlusInterceptor mybatisPlusInterceptor() {
            System.out.println("MpConfig自动运行");
            MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
            // 分页插件
            mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
            return mybatisPlusInterceptor;
        }

       /* @Bean
        @LoadBalanced
        public RestTemplate restTemplate(){
            System.out.println("运行MyConfig的restTemplate");
            return new RestTemplate();
        }*/
}
